<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>19.1.5. email.headerregistry: Custom Header Objects &mdash; Python 3.4.3 documentation</title>
    
    <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '3.4.3',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/sidebar.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python 3.4.3 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="top" title="Python 3.4.3 documentation" href="../index.html" />
    <link rel="up" title="19.1. email — An email and MIME handling package" href="email.html" />
    <link rel="next" title="19.1.6. email.contentmanager: Managing MIME Content" href="email.contentmanager.html" />
    <link rel="prev" title="19.1.4. email.policy: Policy Objects" href="email.policy.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
    <script type="text/javascript" src="../_static/copybutton.js"></script>
    <script type="text/javascript" src="../_static/version_switch.js"></script>
    
 

  </head>
  <body>  
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="email.contentmanager.html" title="19.1.6. email.contentmanager: Managing MIME Content"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="email.policy.html" title="19.1.4. email.policy: Policy Objects"
             accesskey="P">previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
        <li>
          <span class="version_switcher_placeholder">3.4.3</span>
          <a href="../index.html">Documentation</a> &raquo;
        </li>

          <li><a href="index.html" >The Python Standard Library</a> &raquo;</li>
          <li><a href="netdata.html" >19. Internet Data Handling</a> &raquo;</li>
          <li><a href="email.html" accesskey="U">19.1. <tt class="docutils literal"><span class="pre">email</span></tt> &#8212; An email and MIME handling package</a> &raquo;</li> 
      </ul>
    </div>    

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-email.headerregistry">
<span id="email-headerregistry-custom-header-objects"></span><h1>19.1.5. <a class="reference internal" href="#module-email.headerregistry" title="email.headerregistry: Automatic Parsing of headers based on the field name"><tt class="xref py py-mod docutils literal"><span class="pre">email.headerregistry</span></tt></a>: Custom Header Objects<a class="headerlink" href="#module-email.headerregistry" title="Permalink to this headline">¶</a></h1>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The headerregistry module has been included in the standard library on a
<a class="reference internal" href="../glossary.html#term-provisional-package"><em class="xref std std-term">provisional basis</em></a>. Backwards incompatible
changes (up to and including removal of the module) may occur if deemed
necessary by the core developers.</p>
</div>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.3: </span>as a <a class="reference internal" href="../glossary.html#term-provisional-package"><em class="xref std std-term">provisional module</em></a>.</p>
</div>
<p>Headers are represented by customized subclasses of <a class="reference internal" href="stdtypes.html#str" title="str"><tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></a>.  The
particular class used to represent a given header is determined by the
<a class="reference internal" href="email.policy.html#email.policy.EmailPolicy.header_factory" title="email.policy.EmailPolicy.header_factory"><tt class="xref py py-attr docutils literal"><span class="pre">header_factory</span></tt></a> of the <a class="reference internal" href="email.policy.html#module-email.policy" title="email.policy: Controlling the parsing and generating of messages"><tt class="xref py py-mod docutils literal"><span class="pre">policy</span></tt></a> in
effect when the headers are created.  This section documents the particular
<tt class="docutils literal"><span class="pre">header_factory</span></tt> implemented by the email package for handling <span class="target" id="index-0"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc5322.html"><strong>RFC 5322</strong></a>
compliant email messages, which not only provides customized header objects for
various header types, but also provides an extension mechanism for applications
to add their own custom header types.</p>
<p>When using any of the policy objects derived from
<a class="reference internal" href="email.policy.html#email.policy.EmailPolicy" title="email.policy.EmailPolicy"><tt class="xref py py-data docutils literal"><span class="pre">EmailPolicy</span></tt></a>, all headers are produced by
<a class="reference internal" href="#email.headerregistry.HeaderRegistry" title="email.headerregistry.HeaderRegistry"><tt class="xref py py-class docutils literal"><span class="pre">HeaderRegistry</span></tt></a> and have <a class="reference internal" href="#email.headerregistry.BaseHeader" title="email.headerregistry.BaseHeader"><tt class="xref py py-class docutils literal"><span class="pre">BaseHeader</span></tt></a> as their last base
class.  Each header class has an additional base class that is determined by
the type of the header.  For example, many headers have the class
<a class="reference internal" href="#email.headerregistry.UnstructuredHeader" title="email.headerregistry.UnstructuredHeader"><tt class="xref py py-class docutils literal"><span class="pre">UnstructuredHeader</span></tt></a> as their other base class.  The specialized second
class for a header is determined by the name of the header, using a lookup
table stored in the <a class="reference internal" href="#email.headerregistry.HeaderRegistry" title="email.headerregistry.HeaderRegistry"><tt class="xref py py-class docutils literal"><span class="pre">HeaderRegistry</span></tt></a>.  All of this is managed
transparently for the typical application program, but interfaces are provided
for modifying the default behavior for use by more complex applications.</p>
<p>The sections below first document the header base classes and their attributes,
followed by the API for modifying the behavior of <a class="reference internal" href="#email.headerregistry.HeaderRegistry" title="email.headerregistry.HeaderRegistry"><tt class="xref py py-class docutils literal"><span class="pre">HeaderRegistry</span></tt></a>, and
finally the support classes used to represent the data parsed from structured
headers.</p>
<dl class="class">
<dt id="email.headerregistry.BaseHeader">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">BaseHeader</tt><big>(</big><em>name</em>, <em>value</em><big>)</big><a class="headerlink" href="#email.headerregistry.BaseHeader" title="Permalink to this definition">¶</a></dt>
<dd><p><em>name</em> and <em>value</em> are passed to <tt class="docutils literal"><span class="pre">BaseHeader</span></tt> from the
<a class="reference internal" href="email.policy.html#email.policy.EmailPolicy.header_factory" title="email.policy.EmailPolicy.header_factory"><tt class="xref py py-attr docutils literal"><span class="pre">header_factory</span></tt></a> call.  The string value of
any header object is the <em>value</em> fully decoded to unicode.</p>
<p>This base class defines the following read-only properties:</p>
<dl class="attribute">
<dt id="email.headerregistry.BaseHeader.name">
<tt class="descname">name</tt><a class="headerlink" href="#email.headerregistry.BaseHeader.name" title="Permalink to this definition">¶</a></dt>
<dd><p>The name of the header (the portion of the field before the &#8216;:&#8217;).  This
is exactly the value passed in the
<a class="reference internal" href="email.policy.html#email.policy.EmailPolicy.header_factory" title="email.policy.EmailPolicy.header_factory"><tt class="xref py py-attr docutils literal"><span class="pre">header_factory</span></tt></a> call for <em>name</em>; that
is, case is preserved.</p>
</dd></dl>

<dl class="attribute">
<dt id="email.headerregistry.BaseHeader.defects">
<tt class="descname">defects</tt><a class="headerlink" href="#email.headerregistry.BaseHeader.defects" title="Permalink to this definition">¶</a></dt>
<dd><p>A tuple of <tt class="xref py py-exc docutils literal"><span class="pre">HeaderDefect</span></tt> instances reporting any
RFC compliance problems found during parsing.  The email package tries to
be complete about detecting compliance issues.  See the <a class="reference internal" href="email.errors.html#module-email.errors" title="email.errors: The exception classes used by the email package."><tt class="xref py py-mod docutils literal"><span class="pre">errors</span></tt></a>
module for a discussion of the types of defects that may be reported.</p>
</dd></dl>

<dl class="attribute">
<dt id="email.headerregistry.BaseHeader.max_count">
<tt class="descname">max_count</tt><a class="headerlink" href="#email.headerregistry.BaseHeader.max_count" title="Permalink to this definition">¶</a></dt>
<dd><p>The maximum number of headers of this type that can have the same
<tt class="docutils literal"><span class="pre">name</span></tt>.  A value of <tt class="docutils literal"><span class="pre">None</span></tt> means unlimited.  The <tt class="docutils literal"><span class="pre">BaseHeader</span></tt> value
for this attribute is <tt class="docutils literal"><span class="pre">None</span></tt>; it is expected that specialized header
classes will override this value as needed.</p>
</dd></dl>

<p><tt class="docutils literal"><span class="pre">BaseHeader</span></tt> also provides the following method, which is called by the
email library code and should not in general be called by application
programs:</p>
<dl class="method">
<dt id="email.headerregistry.BaseHeader.fold">
<tt class="descname">fold</tt><big>(</big><em>*</em>, <em>policy</em><big>)</big><a class="headerlink" href="#email.headerregistry.BaseHeader.fold" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a string containing <a class="reference internal" href="email.policy.html#email.policy.Policy.linesep" title="email.policy.Policy.linesep"><tt class="xref py py-attr docutils literal"><span class="pre">linesep</span></tt></a>
characters as required to correctly fold the header according
to <em>policy</em>.  A <a class="reference internal" href="email.policy.html#email.policy.Policy.cte_type" title="email.policy.Policy.cte_type"><tt class="xref py py-attr docutils literal"><span class="pre">cte_type</span></tt></a> of
<tt class="docutils literal"><span class="pre">8bit</span></tt> will be treated as if it were <tt class="docutils literal"><span class="pre">7bit</span></tt>, since strings
may not contain binary data.</p>
</dd></dl>

<p><tt class="docutils literal"><span class="pre">BaseHeader</span></tt> by itself cannot be used to create a header object.  It
defines a protocol that each specialized header cooperates with in order to
produce the header object.  Specifically, <tt class="docutils literal"><span class="pre">BaseHeader</span></tt> requires that
the specialized class provide a <a class="reference internal" href="functions.html#classmethod" title="classmethod"><tt class="xref py py-func docutils literal"><span class="pre">classmethod()</span></tt></a> named <tt class="docutils literal"><span class="pre">parse</span></tt>.  This
method is called as follows:</p>
<div class="highlight-python3"><div class="highlight"><pre><span class="n">parse</span><span class="p">(</span><span class="n">string</span><span class="p">,</span> <span class="n">kwds</span><span class="p">)</span>
</pre></div>
</div>
<p><tt class="docutils literal"><span class="pre">kwds</span></tt> is a dictionary containing one pre-initialized key, <tt class="docutils literal"><span class="pre">defects</span></tt>.
<tt class="docutils literal"><span class="pre">defects</span></tt> is an empty list.  The parse method should append any detected
defects to this list.  On return, the <tt class="docutils literal"><span class="pre">kwds</span></tt> dictionary <em>must</em> contain
values for at least the keys <tt class="docutils literal"><span class="pre">decoded</span></tt> and <tt class="docutils literal"><span class="pre">defects</span></tt>.  <tt class="docutils literal"><span class="pre">decoded</span></tt>
should be the string value for the header (that is, the header value fully
decoded to unicode).  The parse method should assume that <em>string</em> may
contain transport encoded parts, but should correctly handle all valid
unicode characters as well so that it can parse un-encoded header values.</p>
<p><tt class="docutils literal"><span class="pre">BaseHeader</span></tt>&#8216;s <tt class="docutils literal"><span class="pre">__new__</span></tt> then creates the header instance, and calls its
<tt class="docutils literal"><span class="pre">init</span></tt> method.  The specialized class only needs to provide an <tt class="docutils literal"><span class="pre">init</span></tt>
method if it wishes to set additional attributes beyond those provided by
<tt class="docutils literal"><span class="pre">BaseHeader</span></tt> itself.  Such an <tt class="docutils literal"><span class="pre">init</span></tt> method should look like this:</p>
<div class="highlight-python3"><div class="highlight"><pre><span class="k">def</span> <span class="nf">init</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">):</span>
    <span class="bp">self</span><span class="o">.</span><span class="n">_myattr</span> <span class="o">=</span> <span class="n">kw</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s">&#39;myattr&#39;</span><span class="p">)</span>
    <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">init</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span>
</pre></div>
</div>
<p>That is, anything extra that the specialized class puts in to the <tt class="docutils literal"><span class="pre">kwds</span></tt>
dictionary should be removed and handled, and the remaining contents of
<tt class="docutils literal"><span class="pre">kw</span></tt> (and <tt class="docutils literal"><span class="pre">args</span></tt>) passed to the <tt class="docutils literal"><span class="pre">BaseHeader</span></tt> <tt class="docutils literal"><span class="pre">init</span></tt> method.</p>
</dd></dl>

<dl class="class">
<dt id="email.headerregistry.UnstructuredHeader">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">UnstructuredHeader</tt><a class="headerlink" href="#email.headerregistry.UnstructuredHeader" title="Permalink to this definition">¶</a></dt>
<dd><p>An &#8220;unstructured&#8221; header is the default type of header in <span class="target" id="index-1"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc5322.html"><strong>RFC 5322</strong></a>.
Any header that does not have a specified syntax is treated as
unstructured.  The classic example of an unstructured header is the
<em class="mailheader">Subject</em> header.</p>
<p>In <span class="target" id="index-2"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc5322.html"><strong>RFC 5322</strong></a>, an unstructured header is a run of arbitrary text in the
ASCII character set.  <span class="target" id="index-3"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc2047.html"><strong>RFC 2047</strong></a>, however, has an <span class="target" id="index-4"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc5322.html"><strong>RFC 5322</strong></a> compatible
mechanism for encoding non-ASCII text as ASCII characters within a header
value.  When a <em>value</em> containing encoded words is passed to the
constructor, the <tt class="docutils literal"><span class="pre">UnstructuredHeader</span></tt> parser converts such encoded words
back in to the original unicode, following the <span class="target" id="index-5"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc2047.html"><strong>RFC 2047</strong></a> rules for
unstructured text.  The parser uses heuristics to attempt to decode certain
non-compliant encoded words.  Defects are registered in such cases, as well
as defects for issues such as invalid characters within the encoded words or
the non-encoded text.</p>
<p>This header type provides no additional attributes.</p>
</dd></dl>

<dl class="class">
<dt id="email.headerregistry.DateHeader">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">DateHeader</tt><a class="headerlink" href="#email.headerregistry.DateHeader" title="Permalink to this definition">¶</a></dt>
<dd><p><span class="target" id="index-6"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc5322.html"><strong>RFC 5322</strong></a> specifies a very specific format for dates within email headers.
The <tt class="docutils literal"><span class="pre">DateHeader</span></tt> parser recognizes that date format, as well as
recognizing a number of variant forms that are sometimes found &#8220;in the
wild&#8221;.</p>
<p>This header type provides the following additional attributes:</p>
<dl class="attribute">
<dt id="email.headerregistry.DateHeader.datetime">
<tt class="descname">datetime</tt><a class="headerlink" href="#email.headerregistry.DateHeader.datetime" title="Permalink to this definition">¶</a></dt>
<dd><p>If the header value can be recognized as a valid date of one form or
another, this attribute will contain a <a class="reference internal" href="datetime.html#datetime.datetime" title="datetime.datetime"><tt class="xref py py-class docutils literal"><span class="pre">datetime</span></tt></a>
instance representing that date.  If the timezone of the input date is
specified as <tt class="docutils literal"><span class="pre">-0000</span></tt> (indicating it is in UTC but contains no
information about the source timezone), then <a class="reference internal" href="#email.headerregistry.DateHeader.datetime" title="email.headerregistry.DateHeader.datetime"><tt class="xref py py-attr docutils literal"><span class="pre">datetime</span></tt></a> will be a
naive <a class="reference internal" href="datetime.html#datetime.datetime" title="datetime.datetime"><tt class="xref py py-class docutils literal"><span class="pre">datetime</span></tt></a>.  If a specific timezone offset is
found (including <cite>+0000</cite>), then <a class="reference internal" href="#email.headerregistry.DateHeader.datetime" title="email.headerregistry.DateHeader.datetime"><tt class="xref py py-attr docutils literal"><span class="pre">datetime</span></tt></a> will contain an aware
<tt class="docutils literal"><span class="pre">datetime</span></tt> that uses <a class="reference internal" href="datetime.html#datetime.timezone" title="datetime.timezone"><tt class="xref py py-class docutils literal"><span class="pre">datetime.timezone</span></tt></a> to record the timezone
offset.</p>
</dd></dl>

<p>The <tt class="docutils literal"><span class="pre">decoded</span></tt> value of the header is determined by formatting the
<tt class="docutils literal"><span class="pre">datetime</span></tt> according to the <span class="target" id="index-7"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc5322.html"><strong>RFC 5322</strong></a> rules; that is, it is set to:</p>
<div class="highlight-python3"><div class="highlight"><pre><span class="n">email</span><span class="o">.</span><span class="n">utils</span><span class="o">.</span><span class="n">format_datetime</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">datetime</span><span class="p">)</span>
</pre></div>
</div>
<p>When creating a <tt class="docutils literal"><span class="pre">DateHeader</span></tt>, <em>value</em> may be
<a class="reference internal" href="datetime.html#datetime.datetime" title="datetime.datetime"><tt class="xref py py-class docutils literal"><span class="pre">datetime</span></tt></a> instance.  This means, for example, that
the following code is valid and does what one would expect:</p>
<div class="highlight-python3"><div class="highlight"><pre><span class="n">msg</span><span class="p">[</span><span class="s">&#39;Date&#39;</span><span class="p">]</span>  <span class="o">=</span> <span class="n">datetime</span><span class="p">(</span><span class="mi">2011</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">21</span><span class="p">)</span>
</pre></div>
</div>
<p>Because this is a naive <tt class="docutils literal"><span class="pre">datetime</span></tt> it will be interpreted as a UTC
timestamp, and the resulting value will have a timezone of <tt class="docutils literal"><span class="pre">-0000</span></tt>.  Much
more useful is to use the <a class="reference internal" href="email.util.html#email.utils.localtime" title="email.utils.localtime"><tt class="xref py py-func docutils literal"><span class="pre">localtime()</span></tt></a> function from the
<a class="reference internal" href="email.util.html#module-email.utils" title="email.utils: Miscellaneous email package utilities."><tt class="xref py py-mod docutils literal"><span class="pre">utils</span></tt></a> module:</p>
<div class="highlight-python3"><div class="highlight"><pre><span class="n">msg</span><span class="p">[</span><span class="s">&#39;Date&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">utils</span><span class="o">.</span><span class="n">localtime</span><span class="p">()</span>
</pre></div>
</div>
<p>This example sets the date header to the current time and date using
the current timezone offset.</p>
</dd></dl>

<dl class="class">
<dt id="email.headerregistry.AddressHeader">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">AddressHeader</tt><a class="headerlink" href="#email.headerregistry.AddressHeader" title="Permalink to this definition">¶</a></dt>
<dd><p>Address headers are one of the most complex structured header types.
The <tt class="docutils literal"><span class="pre">AddressHeader</span></tt> class provides a generic interface to any address
header.</p>
<p>This header type provides the following additional attributes:</p>
<dl class="attribute">
<dt id="email.headerregistry.AddressHeader.groups">
<tt class="descname">groups</tt><a class="headerlink" href="#email.headerregistry.AddressHeader.groups" title="Permalink to this definition">¶</a></dt>
<dd><p>A tuple of <a class="reference internal" href="#email.headerregistry.Group" title="email.headerregistry.Group"><tt class="xref py py-class docutils literal"><span class="pre">Group</span></tt></a> objects encoding the
addresses and groups found in the header value.  Addresses that are
not part of a group are represented in this list as single-address
<tt class="docutils literal"><span class="pre">Groups</span></tt> whose <a class="reference internal" href="#email.headerregistry.Group.display_name" title="email.headerregistry.Group.display_name"><tt class="xref py py-attr docutils literal"><span class="pre">display_name</span></tt></a> is <tt class="docutils literal"><span class="pre">None</span></tt>.</p>
</dd></dl>

<dl class="attribute">
<dt id="email.headerregistry.AddressHeader.addresses">
<tt class="descname">addresses</tt><a class="headerlink" href="#email.headerregistry.AddressHeader.addresses" title="Permalink to this definition">¶</a></dt>
<dd><p>A tuple of <a class="reference internal" href="#email.headerregistry.Address" title="email.headerregistry.Address"><tt class="xref py py-class docutils literal"><span class="pre">Address</span></tt></a> objects encoding all
of the individual addresses from the header value.  If the header value
contains any groups, the individual addresses from the group are included
in the list at the point where the group occurs in the value (that is,
the list of addresses is &#8220;flattened&#8221; into a one dimensional list).</p>
</dd></dl>

<p>The <tt class="docutils literal"><span class="pre">decoded</span></tt> value of the header will have all encoded words decoded to
unicode.  <a class="reference internal" href="codecs.html#module-encodings.idna" title="encodings.idna: Internationalized Domain Names implementation"><tt class="xref py py-class docutils literal"><span class="pre">idna</span></tt></a> encoded domain names are also decoded to unicode.  The
<tt class="docutils literal"><span class="pre">decoded</span></tt> value is set by <a class="reference internal" href="stdtypes.html#str.join" title="str.join"><tt class="xref py py-attr docutils literal"><span class="pre">join</span></tt></a>ing the <a class="reference internal" href="stdtypes.html#str" title="str"><tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></a> value of
the elements of the <tt class="docutils literal"><span class="pre">groups</span></tt> attribute with <tt class="docutils literal"><span class="pre">',</span> <span class="pre">'</span></tt>.</p>
<p>A list of <a class="reference internal" href="#email.headerregistry.Address" title="email.headerregistry.Address"><tt class="xref py py-class docutils literal"><span class="pre">Address</span></tt></a> and <a class="reference internal" href="#email.headerregistry.Group" title="email.headerregistry.Group"><tt class="xref py py-class docutils literal"><span class="pre">Group</span></tt></a> objects in any combination
may be used to set the value of an address header.  <tt class="docutils literal"><span class="pre">Group</span></tt> objects whose
<tt class="docutils literal"><span class="pre">display_name</span></tt> is <tt class="docutils literal"><span class="pre">None</span></tt> will be interpreted as single addresses, which
allows an address list to be copied with groups intact by using the list
obtained <tt class="docutils literal"><span class="pre">groups</span></tt> attribute of the source header.</p>
</dd></dl>

<dl class="class">
<dt id="email.headerregistry.SingleAddressHeader">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">SingleAddressHeader</tt><a class="headerlink" href="#email.headerregistry.SingleAddressHeader" title="Permalink to this definition">¶</a></dt>
<dd><p>A subclass of <a class="reference internal" href="#email.headerregistry.AddressHeader" title="email.headerregistry.AddressHeader"><tt class="xref py py-class docutils literal"><span class="pre">AddressHeader</span></tt></a> that adds one
additional attribute:</p>
<dl class="attribute">
<dt id="email.headerregistry.SingleAddressHeader.address">
<tt class="descname">address</tt><a class="headerlink" href="#email.headerregistry.SingleAddressHeader.address" title="Permalink to this definition">¶</a></dt>
<dd><p>The single address encoded by the header value.  If the header value
actually contains more than one address (which would be a violation of
the RFC under the default <a class="reference internal" href="email.policy.html#module-email.policy" title="email.policy: Controlling the parsing and generating of messages"><tt class="xref py py-mod docutils literal"><span class="pre">policy</span></tt></a>), accessing this attribute
will result in a <a class="reference internal" href="exceptions.html#ValueError" title="ValueError"><tt class="xref py py-exc docutils literal"><span class="pre">ValueError</span></tt></a>.</p>
</dd></dl>

</dd></dl>

<p>Many of the above classes also have a <tt class="docutils literal"><span class="pre">Unique</span></tt> variant (for example,
<tt class="docutils literal"><span class="pre">UniqueUnstructuredHeader</span></tt>).  The only difference is that in the <tt class="docutils literal"><span class="pre">Unique</span></tt>
variant, <a class="reference internal" href="#email.headerregistry.BaseHeader.max_count" title="email.headerregistry.BaseHeader.max_count"><tt class="xref py py-attr docutils literal"><span class="pre">max_count</span></tt></a> is set to 1.</p>
<dl class="class">
<dt id="email.headerregistry.MIMEVersionHeader">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">MIMEVersionHeader</tt><a class="headerlink" href="#email.headerregistry.MIMEVersionHeader" title="Permalink to this definition">¶</a></dt>
<dd><p>There is really only one valid value for the <em class="mailheader">MIME-Version</em>
header, and that is <tt class="docutils literal"><span class="pre">1.0</span></tt>.  For future proofing, this header class
supports other valid version numbers.  If a version number has a valid value
per <span class="target" id="index-8"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc2045.html"><strong>RFC 2045</strong></a>, then the header object will have non-<tt class="docutils literal"><span class="pre">None</span></tt> values for
the following attributes:</p>
<dl class="attribute">
<dt id="email.headerregistry.MIMEVersionHeader.version">
<tt class="descname">version</tt><a class="headerlink" href="#email.headerregistry.MIMEVersionHeader.version" title="Permalink to this definition">¶</a></dt>
<dd><p>The version number as a string, with any whitespace and/or comments
removed.</p>
</dd></dl>

<dl class="attribute">
<dt id="email.headerregistry.MIMEVersionHeader.major">
<tt class="descname">major</tt><a class="headerlink" href="#email.headerregistry.MIMEVersionHeader.major" title="Permalink to this definition">¶</a></dt>
<dd><p>The major version number as an integer</p>
</dd></dl>

<dl class="attribute">
<dt id="email.headerregistry.MIMEVersionHeader.minor">
<tt class="descname">minor</tt><a class="headerlink" href="#email.headerregistry.MIMEVersionHeader.minor" title="Permalink to this definition">¶</a></dt>
<dd><p>The minor version number as an integer</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="email.headerregistry.ParameterizedMIMEHeader">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">ParameterizedMIMEHeader</tt><a class="headerlink" href="#email.headerregistry.ParameterizedMIMEHeader" title="Permalink to this definition">¶</a></dt>
<dd><p>MOME headers all start with the prefix &#8216;Content-&#8216;.  Each specific header has
a certain value, described under the class for that header.  Some can
also take a list of supplemental parameters, which have a common format.
This class serves as a base for all the MIME headers that take parameters.</p>
<dl class="attribute">
<dt id="email.headerregistry.ParameterizedMIMEHeader.params">
<tt class="descname">params</tt><a class="headerlink" href="#email.headerregistry.ParameterizedMIMEHeader.params" title="Permalink to this definition">¶</a></dt>
<dd><p>A dictionary mapping parameter names to parameter values.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="email.headerregistry.ContentTypeHeader">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">ContentTypeHeader</tt><a class="headerlink" href="#email.headerregistry.ContentTypeHeader" title="Permalink to this definition">¶</a></dt>
<dd><p>A <a class="reference internal" href="#email.headerregistry.ParameterizedMIMEHeader" title="email.headerregistry.ParameterizedMIMEHeader"><tt class="xref py py-class docutils literal"><span class="pre">ParameterizedMIMEHeader</span></tt></a> class that handles the
<em class="mailheader">Content-Type</em> header.</p>
<dl class="attribute">
<dt id="email.headerregistry.ContentTypeHeader.content_type">
<tt class="descname">content_type</tt><a class="headerlink" href="#email.headerregistry.ContentTypeHeader.content_type" title="Permalink to this definition">¶</a></dt>
<dd><p>The content type string, in the form <tt class="docutils literal"><span class="pre">maintype/subtype</span></tt>.</p>
</dd></dl>

<dl class="attribute">
<dt id="email.headerregistry.ContentTypeHeader.maintype">
<tt class="descname">maintype</tt><a class="headerlink" href="#email.headerregistry.ContentTypeHeader.maintype" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="email.headerregistry.ContentTypeHeader.subtype">
<tt class="descname">subtype</tt><a class="headerlink" href="#email.headerregistry.ContentTypeHeader.subtype" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="email.headerregistry.ContentDispositionHeader">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">ContentDispositionHeader</tt><a class="headerlink" href="#email.headerregistry.ContentDispositionHeader" title="Permalink to this definition">¶</a></dt>
<dd><p>A <a class="reference internal" href="#email.headerregistry.ParameterizedMIMEHeader" title="email.headerregistry.ParameterizedMIMEHeader"><tt class="xref py py-class docutils literal"><span class="pre">ParameterizedMIMEHeader</span></tt></a> class that handles the
<em class="mailheader">Content-Disposition</em> header.</p>
<dl class="attribute">
<dt>
<tt class="descname">content-disposition</tt></dt>
<dd><p><tt class="docutils literal"><span class="pre">inline</span></tt> and <tt class="docutils literal"><span class="pre">attachment</span></tt> are the only valid values in common use.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="email.headerregistry.ContentTransferEncoding">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">ContentTransferEncoding</tt><a class="headerlink" href="#email.headerregistry.ContentTransferEncoding" title="Permalink to this definition">¶</a></dt>
<dd><p>Handles the <em class="mailheader">Content-Transfer-Encoding</em> header.</p>
<dl class="attribute">
<dt id="email.headerregistry.ContentTransferEncoding.cte">
<tt class="descname">cte</tt><a class="headerlink" href="#email.headerregistry.ContentTransferEncoding.cte" title="Permalink to this definition">¶</a></dt>
<dd><p>Valid values are <tt class="docutils literal"><span class="pre">7bit</span></tt>, <tt class="docutils literal"><span class="pre">8bit</span></tt>, <tt class="docutils literal"><span class="pre">base64</span></tt>, and
<tt class="docutils literal"><span class="pre">quoted-printable</span></tt>.  See <span class="target" id="index-9"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc2045.html"><strong>RFC 2045</strong></a> for more information.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="email.headerregistry.HeaderRegistry">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">HeaderRegistry</tt><big>(</big><em>base_class=BaseHeader</em>, <em>default_class=UnstructuredHeader</em>, <em>use_default_map=True</em><big>)</big><a class="headerlink" href="#email.headerregistry.HeaderRegistry" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the factory used by <a class="reference internal" href="email.policy.html#email.policy.EmailPolicy" title="email.policy.EmailPolicy"><tt class="xref py py-class docutils literal"><span class="pre">EmailPolicy</span></tt></a> by default.
<tt class="docutils literal"><span class="pre">HeaderRegistry</span></tt> builds the class used to create a header instance
dynamically, using <em>base_class</em> and a specialized class retrieved from a
registry that it holds.  When a given header name does not appear in the
registry, the class specified by <em>default_class</em> is used as the specialized
class.  When <em>use_default_map</em> is <tt class="docutils literal"><span class="pre">True</span></tt> (the default), the standard
mapping of header names to classes is copied in to the registry during
initialization.  <em>base_class</em> is always the last class in the generated
class&#8217;s <tt class="docutils literal"><span class="pre">__bases__</span></tt> list.</p>
<p>The default mappings are:</p>
<blockquote>
<div><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">subject:</th><td class="field-body">UniqueUnstructuredHeader</td>
</tr>
<tr class="field-even field"><th class="field-name">date:</th><td class="field-body">UniqueDateHeader</td>
</tr>
<tr class="field-odd field"><th class="field-name">resent-date:</th><td class="field-body">DateHeader</td>
</tr>
<tr class="field-even field"><th class="field-name">orig-date:</th><td class="field-body">UniqueDateHeader</td>
</tr>
<tr class="field-odd field"><th class="field-name">sender:</th><td class="field-body">UniqueSingleAddressHeader</td>
</tr>
<tr class="field-even field"><th class="field-name">resent-sender:</th><td class="field-body">SingleAddressHeader</td>
</tr>
<tr class="field-odd field"><th class="field-name">to:</th><td class="field-body">UniqueAddressHeader</td>
</tr>
<tr class="field-even field"><th class="field-name">resent-to:</th><td class="field-body">AddressHeader</td>
</tr>
<tr class="field-odd field"><th class="field-name">cc:</th><td class="field-body">UniqueAddressHeader</td>
</tr>
<tr class="field-even field"><th class="field-name">resent-cc:</th><td class="field-body">AddressHeader</td>
</tr>
<tr class="field-odd field"><th class="field-name">from:</th><td class="field-body">UniqueAddressHeader</td>
</tr>
<tr class="field-even field"><th class="field-name">resent-from:</th><td class="field-body">AddressHeader</td>
</tr>
<tr class="field-odd field"><th class="field-name">reply-to:</th><td class="field-body">UniqueAddressHeader</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p><tt class="docutils literal"><span class="pre">HeaderRegistry</span></tt> has the following methods:</p>
<dl class="method">
<dt id="email.headerregistry.HeaderRegistry.map_to_type">
<tt class="descname">map_to_type</tt><big>(</big><em>self</em>, <em>name</em>, <em>cls</em><big>)</big><a class="headerlink" href="#email.headerregistry.HeaderRegistry.map_to_type" title="Permalink to this definition">¶</a></dt>
<dd><p><em>name</em> is the name of the header to be mapped.  It will be converted to
lower case in the registry.  <em>cls</em> is the specialized class to be used,
along with <em>base_class</em>, to create the class used to instantiate headers
that match <em>name</em>.</p>
</dd></dl>

<dl class="method">
<dt id="email.headerregistry.HeaderRegistry.__getitem__">
<tt class="descname">__getitem__</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#email.headerregistry.HeaderRegistry.__getitem__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct and return a class to handle creating a <em>name</em> header.</p>
</dd></dl>

<dl class="method">
<dt id="email.headerregistry.HeaderRegistry.__call__">
<tt class="descname">__call__</tt><big>(</big><em>name</em>, <em>value</em><big>)</big><a class="headerlink" href="#email.headerregistry.HeaderRegistry.__call__" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieves the specialized header associated with <em>name</em> from the
registry (using <em>default_class</em> if <em>name</em> does not appear in the
registry) and composes it with <em>base_class</em> to produce a class,
calls the constructed class&#8217;s constructor, passing it the same
argument list, and finally returns the class instance created thereby.</p>
</dd></dl>

</dd></dl>

<p>The following classes are the classes used to represent data parsed from
structured headers and can, in general, be used by an application program to
construct structured values to assign to specific headers.</p>
<dl class="class">
<dt id="email.headerregistry.Address">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">Address</tt><big>(</big><em>display_name=''</em>, <em>username=''</em>, <em>domain=''</em>, <em>addr_spec=None</em><big>)</big><a class="headerlink" href="#email.headerregistry.Address" title="Permalink to this definition">¶</a></dt>
<dd><p>The class used to represent an email address.  The general form of an
address is:</p>
<div class="highlight-python3"><div class="highlight"><pre><span class="p">[</span><span class="n">display_name</span><span class="p">]</span> <span class="o">&lt;</span><span class="n">username</span><span class="nd">@domain</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>or:</p>
<div class="highlight-python3"><div class="highlight"><pre><span class="n">username</span><span class="nd">@domain</span>
</pre></div>
</div>
<p>where each part must conform to specific syntax rules spelled out in
<span class="target" id="index-10"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc5322.html"><strong>RFC 5322</strong></a>.</p>
<p>As a convenience <em>addr_spec</em> can be specified instead of <em>username</em> and
<em>domain</em>, in which case <em>username</em> and <em>domain</em> will be parsed from the
<em>addr_spec</em>.  An <em>addr_spec</em> must be a properly RFC quoted string; if it is
not <tt class="docutils literal"><span class="pre">Address</span></tt> will raise an error.  Unicode characters are allowed and
will be property encoded when serialized.  However, per the RFCs, unicode is
<em>not</em> allowed in the username portion of the address.</p>
<dl class="attribute">
<dt id="email.headerregistry.Address.display_name">
<tt class="descname">display_name</tt><a class="headerlink" href="#email.headerregistry.Address.display_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The display name portion of the address, if any, with all quoting
removed.  If the address does not have a display name, this attribute
will be an empty string.</p>
</dd></dl>

<dl class="attribute">
<dt id="email.headerregistry.Address.username">
<tt class="descname">username</tt><a class="headerlink" href="#email.headerregistry.Address.username" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">username</span></tt> portion of the address, with all quoting removed.</p>
</dd></dl>

<dl class="attribute">
<dt id="email.headerregistry.Address.domain">
<tt class="descname">domain</tt><a class="headerlink" href="#email.headerregistry.Address.domain" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">domain</span></tt> portion of the address.</p>
</dd></dl>

<dl class="attribute">
<dt id="email.headerregistry.Address.addr_spec">
<tt class="descname">addr_spec</tt><a class="headerlink" href="#email.headerregistry.Address.addr_spec" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">username&#64;domain</span></tt> portion of the address, correctly quoted
for use as a bare address (the second form shown above).  This
attribute is not mutable.</p>
</dd></dl>

<dl class="method">
<dt id="email.headerregistry.Address.__str__">
<tt class="descname">__str__</tt><big>(</big><big>)</big><a class="headerlink" href="#email.headerregistry.Address.__str__" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">str</span></tt> value of the object is the address quoted according to
<span class="target" id="index-11"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc5322.html"><strong>RFC 5322</strong></a> rules, but with no Content Transfer Encoding of any non-ASCII
characters.</p>
</dd></dl>

<p>To support SMTP (<span class="target" id="index-12"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc5321.html"><strong>RFC 5321</strong></a>), <tt class="docutils literal"><span class="pre">Address</span></tt> handles one special case: if
<tt class="docutils literal"><span class="pre">username</span></tt> and <tt class="docutils literal"><span class="pre">domain</span></tt> are both the empty string (or <tt class="docutils literal"><span class="pre">None</span></tt>), then
the string value of the <tt class="docutils literal"><span class="pre">Address</span></tt> is <tt class="docutils literal"><span class="pre">&lt;&gt;</span></tt>.</p>
</dd></dl>

<dl class="class">
<dt id="email.headerregistry.Group">
<em class="property">class </em><tt class="descclassname">email.headerregistry.</tt><tt class="descname">Group</tt><big>(</big><em>display_name=None</em>, <em>addresses=None</em><big>)</big><a class="headerlink" href="#email.headerregistry.Group" title="Permalink to this definition">¶</a></dt>
<dd><p>The class used to represent an address group.  The general form of an
address group is:</p>
<div class="highlight-python3"><div class="highlight"><pre><span class="n">display_name</span><span class="p">:</span> <span class="p">[</span><span class="n">address</span><span class="o">-</span><span class="nb">list</span><span class="p">];</span>
</pre></div>
</div>
<p>As a convenience for processing lists of addresses that consist of a mixture
of groups and single addresses, a <tt class="docutils literal"><span class="pre">Group</span></tt> may also be used to represent
single addresses that are not part of a group by setting <em>display_name</em> to
<tt class="docutils literal"><span class="pre">None</span></tt> and providing a list of the single address as <em>addresses</em>.</p>
<dl class="attribute">
<dt id="email.headerregistry.Group.display_name">
<tt class="descname">display_name</tt><a class="headerlink" href="#email.headerregistry.Group.display_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">display_name</span></tt> of the group.  If it is <tt class="docutils literal"><span class="pre">None</span></tt> and there is
exactly one <tt class="docutils literal"><span class="pre">Address</span></tt> in <tt class="docutils literal"><span class="pre">addresses</span></tt>, then the <tt class="docutils literal"><span class="pre">Group</span></tt> represents a
single address that is not in a group.</p>
</dd></dl>

<dl class="attribute">
<dt id="email.headerregistry.Group.addresses">
<tt class="descname">addresses</tt><a class="headerlink" href="#email.headerregistry.Group.addresses" title="Permalink to this definition">¶</a></dt>
<dd><p>A possibly empty tuple of <a class="reference internal" href="#email.headerregistry.Address" title="email.headerregistry.Address"><tt class="xref py py-class docutils literal"><span class="pre">Address</span></tt></a> objects representing the
addresses in the group.</p>
</dd></dl>

<dl class="method">
<dt id="email.headerregistry.Group.__str__">
<tt class="descname">__str__</tt><big>(</big><big>)</big><a class="headerlink" href="#email.headerregistry.Group.__str__" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">str</span></tt> value of a <tt class="docutils literal"><span class="pre">Group</span></tt> is formatted according to <span class="target" id="index-13"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc5322.html"><strong>RFC 5322</strong></a>,
but with no Content Transfer Encoding of any non-ASCII characters.  If
<tt class="docutils literal"><span class="pre">display_name</span></tt> is none and there is a single <tt class="docutils literal"><span class="pre">Address</span></tt> in the
<tt class="docutils literal"><span class="pre">addresses</span></tt> list, the <tt class="docutils literal"><span class="pre">str</span></tt> value will be the same as the <tt class="docutils literal"><span class="pre">str</span></tt> of
that single <tt class="docutils literal"><span class="pre">Address</span></tt>.</p>
</dd></dl>

</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="email.policy.html"
                        title="previous chapter">19.1.4. <tt class="docutils literal"><span class="pre">email.policy</span></tt>: Policy Objects</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="email.contentmanager.html"
                        title="next chapter">19.1.6. <tt class="docutils literal"><span class="pre">email.contentmanager</span></tt>: Managing MIME Content</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
  <li><a href="../bugs.html">Report a Bug</a></li>
  <li><a href="../_sources/library/email.headerregistry.txt"
         rel="nofollow">Show Source</a></li>
</ul>

<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>  
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="email.contentmanager.html" title="19.1.6. email.contentmanager: Managing MIME Content"
             >next</a> |</li>
        <li class="right" >
          <a href="email.policy.html" title="19.1.4. email.policy: Policy Objects"
             >previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
        <li>
          <span class="version_switcher_placeholder">3.4.3</span>
          <a href="../index.html">Documentation</a> &raquo;
        </li>

          <li><a href="index.html" >The Python Standard Library</a> &raquo;</li>
          <li><a href="netdata.html" >19. Internet Data Handling</a> &raquo;</li>
          <li><a href="email.html" >19.1. <tt class="docutils literal"><span class="pre">email</span></tt> &#8212; An email and MIME handling package</a> &raquo;</li> 
      </ul>
    </div>  
    <div class="footer">
    &copy; <a href="../copyright.html">Copyright</a> 1990-2015, Python Software Foundation.
    <br />
    The Python Software Foundation is a non-profit corporation.
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
    <br />
    Last updated on Feb 26, 2015.
    <a href="../bugs.html">Found a bug</a>?
    <br />
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.2.3.
    </div>

  </body>
</html>